<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
	 xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<h:head>
    <link type="text/css" rel="stylesheet" href="styles/StyleSheet.css" />
    <link type="text/css" rel="stylesheet" href="styles/jquery-ui.css" />
<!--     <script type="text/javascript" src="scripts/jquery.js"></script> -->
    <script type="text/javascript" src="scripts/jquery-ui.js"></script>
    <ui:insert name="header"></ui:insert>
    <title><h:outputText value= "#{commonBean.appTituloVentana}"/></title>
</h:head>
<h:body>
	<div id="Pagina">
		<div id="Cabecera">
			<h:form>
				<h1><h:outputText value= "#{commonBean.appTitulo}"/></h1>
				<div id="CerrarSesion">
					<p:panel id="pnlCerrarSesion" styleClass="pnlLoginContent" rendered="#{userManagedBean.usuarioLogueado}">						
					</p:panel>
				</div>
			</h:form>
		</div>
		<h:graphicImage id ="Logo" value="images/img_uwiener.jpg"/>			
		 <center>
    <p:panel id="TablaLogin">
        <form name='f' action='${request.contextPath}/j_spring_security_check' 	method="post" >

		<table>
			<tr>
				<td><h:outputText value= "#{commonBean.institucionTexto}"/></td>
				<td><h:outputText value= "Universidad Norbert Wiener" styleClass="nombreInstitucion"/></td>
			</tr>
			<tr>
				<td><h:outputLabel for="#{userManagedBean.username}" value="Nombre de Usuario:"/></td>
				<td><input type='text' name='j_username' value='' class="CajaTexto"/></td>
			</tr>
			<tr>
				<td><h:outputLabel for="#{userManagedBean.password}" value="#{commonBean.contrasenaTexto}"/></td>
				<td><input type='password' name='j_password' class="CajaTexto"/></td>
			</tr>
			<tr>
				<td colspan='2'>
				<h:commandButton type="submit" name="submit" value="#{commonBean.loginIniciarSesion}" styleClass="Boton"></h:commandButton>
				</td>
			</tr>
		</table>
	</form>
    </p:panel>
    <div>
    
    	<div id="login-error" style="color:#ff0000; font-weight:bold;" >
        <c:if test="${not empty param.login_error}">
           Su intento de inicio de sesion no se ha realizado correctamente, vuelva a intentarlo.<br />
        </c:if>
		</div>
    	
    	
    </div>
    </center>
	</div>
</h:body>
</html>